home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtsut53.zip / SU1SRC.ZIP / REPDEM05.PAS < prev    next >
Pascal/Delphi Source File  |  1996-08-13  |  2KB  |  97 lines

  1. unit Repdem05;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Buttons, DBTables, Grids,
  8.   ExtCtrls, Printers, PrnGridR, CB_Types, CB_MFunc;
  9.  
  10. type
  11.   Tdem05form = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     Panel1: TPanel;
  14.     DataSource1: TDataSource;
  15.     Panel2: TPanel;
  16.     Query1: TQuery;
  17.     Label1: TLabel;
  18.     Style1: TBitBtn;
  19.     Exit: TBitBtn;
  20.     Query1PartNo: TFloatField;
  21.     Query1VendorNo: TFloatField;
  22.     Query1Description: TStringField;
  23.     Query1OnHand: TFloatField;
  24.     Query1OnOrder: TFloatField;
  25.     Query1Cost: TCurrencyField;
  26.     Query1ListPrice: TCurrencyField;
  27.     PrintGridReport1: TPrintGridReport;
  28.     Style2: TBitBtn;
  29.     Style3: TBitBtn;
  30.     Style4: TBitBtn;
  31.     Style5: TBitBtn;
  32.     procedure FormCreate(Sender: TObject);
  33.     procedure Style1Click(Sender: TObject);
  34.     procedure Style2Click(Sender: TObject);
  35.     procedure Style3Click(Sender: TObject);
  36.     procedure Style4Click(Sender: TObject);
  37.     procedure Style5Click(Sender: TObject);
  38.   private
  39.     { private declarations }
  40.   public
  41.   end;
  42.  
  43. var
  44.   dem05form: Tdem05form;
  45.  
  46. implementation
  47.  
  48. {$R *.DFM}
  49.  
  50. procedure Tdem05form.FormCreate(Sender: TObject);
  51. begin
  52.   Query1.Open;
  53.  
  54.   PrintGridReport1.Orientation := Portrait;
  55.  
  56.   { SubTotals will be on field VenderNo}
  57.   PrintGridReport1.SetSubTotalField(1, 'VendorNo','Vendor Number');
  58.  
  59.   { Do not total next 4 fields, but do all the rest  }
  60.   PrintGridReport1.SetPrintTotal('PartNo', False);
  61.   PrintGridReport1.SetPrintTotal('Cost', False);
  62.   PrintGridReport1.SetPrintTotal('ListPrice', False);
  63.   PrintGridReport1.SetPrintTotal('VenderNo', False);
  64. end;
  65.  
  66. procedure Tdem05form.Style1Click(Sender: TObject);
  67. begin
  68.     PrintGridReport1.ReportStyle := rsColumns;
  69.     PrintGridReport1.Execute;
  70. end;
  71.  
  72.  
  73. procedure Tdem05form.Style2Click(Sender: TObject);
  74. begin
  75.     PrintGridReport1.ReportStyle := rsClassic;
  76.     PrintGridReport1.Execute;
  77. end;
  78.  
  79. procedure Tdem05form.Style3Click(Sender: TObject);
  80. begin
  81.     PrintGridReport1.ReportStyle := rsThinLines;
  82.     PrintGridReport1.Execute;
  83. end;
  84.  
  85. procedure Tdem05form.Style4Click(Sender: TObject);
  86. begin
  87.     PrintGridReport1.ReportStyle := rsThickLines;
  88.     PrintGridReport1.Execute;
  89. end;
  90.  
  91. procedure Tdem05form.Style5Click(Sender: TObject);
  92. begin
  93.     PrintGridReport1.ReportStyle := rsMiddle;
  94.     PrintGridReport1.Execute;
  95. end;
  96.  
  97. end.